import Vue from 'vue'
import Router from 'vue-router'
/* Layout-公用组件 */
import Layout from 'views/layout'
import TopNav from 'common/components/nav/topNav.vue'
import LeftNav from 'common/components/nav/leftNav.vue'
import ChildView from 'common/components/ChildView' // 三级路由视图层
// 审批中心
import awaitApproval from 'views/business/awaitApproval' // 待审批
import confirmSucceed from 'views/business/confirmSucceed' // 已审批

Vue.use(Router)

/**
 * @param {businessRouter}
 * 业务模块路由
 */

export const approveRouter = [
  // 首页
  {
    path: '/approveCenter',
    type: 'approveCenter',
    name: 'approveCenter',
    title: '审批中心',
    component: Layout,
    redirect: '/awaitApprovalModel',
    menuShow: true,
    iconCls: 'icon-caidan',
    children: [
      {
        path: '/configView',
        components: {
          content: ChildView,
          top: TopNav,
          aside: LeftNav
        }
      },
      // 待审批
      {
        path: '/awaitApprovalModel',
        type: 'awaitApprovalModel',
        name: 'awaitApprovalModel',
        title: '待审批',
        components: {
          content: ChildView,
          top: TopNav,
          aside: LeftNav
        },
        menuShow: true,
        redirect: '/awaitApproval',
        iconCls: 'icon-zhediexiaoguo',
        children: [
          {
            path: '/awaitApproval',
            name: '待审批',
            components: {
              content: awaitApproval,
              top: TopNav,
              aside: LeftNav
            },
            menuShow: false,
            meta: { title: '待审批' }
          }
        ]
      },
      // 审批记录
      {
        path: '/confirmSucceedModel',
        type: 'confirmSucceedModel',
        name: 'confirmSucceedModel',
        title: '审批记录',
        components: {
          content: ChildView,
          top: TopNav,
          aside: LeftNav
        },
        menuShow: true,
        redirect: '/confirmSucceed',
        iconCls: 'icon-zhediexiaoguo',
        children: [
          {
            path: '/confirmSucceed',
            name: '审批记录',
            components: {
              content: confirmSucceed,
              top: TopNav,
              aside: LeftNav
            },
            menuShow: false,
            meta: { title: '审批记录' }
          }
        ]
      }
    ]
  }
]

export default approveRouter
